import request from '@/router/axios'
import store from '@/store'
import {getMappingStatus, fenExYuangettoFixed, getLineName, getStationName} from "../../../subwayRat/commonCheck";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  selection: true,
  reserveSelection:false,
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  height: 450,
  column: [
  // {
  //   fixed: true,
  //   label: '主键',
  //   prop: 'id',
  //   span: 24,
  //   type: 'input',
  //   hide: true
  // }, 
  {
    hide: true,
    label: '线路',
    prop: 'lineCode',
    type: 'select',
    search: false,
    cascaderItem: ["stationCode"],
    filterable : true,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true ,// 动态显隐控制不能删除
    formatter:function (row,v) {
      return getLineName(v);
    }
  }, {
    hide: true,
    label: '站点',
    prop: 'stationCode',
    type: 'select',
    filterable : true,
    search: false,
    dicFlag: false,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true,// 动态显隐控制不能删除
    formatter:function (row,v) {
      return getStationName(row.lineCode,v);
    }
  }, {
    label: '售票员',
    prop: 'conductorPersonName',
    search: false,
    hide: false,
  }, {
    label: '员工号',
    prop: 'conductorPersonCode',
    search: false,
    searchslot : true,
    hide: false,
  },  {
    label: '收入日期',
    prop: 'recordTime',
    type: 'date',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true,
    width: 90
  },{
    width: 100,
    hide: false,
    label: '设备操作号',
	searchLabelWidth: 120,
    prop: 'equipmentNumber',
    searchslot : true,
    search: true,
  },{
    hide: false,
    label: 'BOM编号',
    prop: 'bomCode',
    type: 'select',
    search: false,
    searchslot : true,
    display: true// 动态显隐控制不能删除
  },{
    label: 'BOM实点金额',
    prop: 'paidAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'paidAmount');
    },
    search: false,
    hide: false,
    width: 120
  },{
    width: 120,
    label: 'SC系统数据金额',
    prop: 'sysAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'sysAmount');
    },
    search: false,
    hide: true
  }, {
    width: 120,
    label: 'SC售票金额',
    prop: 'scSellAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scSellAmount');
    },
    search: false,
    hide: true
  },{
    width: 120,
    label: 'SC充值金额',
    prop: 'scInvestAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scInvestAmount');
    },
    search: false,
    hide: true
  }, {
    width: 120,
    label: 'SC补票金额',
    prop: 'scFaretkAmount',
    formatter:function (row,value , label, column) {
      return fenExYuangettoFixed(row,'scFaretkAmount');
    },
    search: false,
    hide: true
  },
  //   {
  //   label: '差异金额',
  //   prop: 'diffMoney',
  //   formatter:function (row,value , label, column) {
  //     return fenExYuangettoFixed(row,'differenceAmount');
  //   },
  //   search: false,
  //   hide: true,
  // },
    {
    label: '通知时间',
    prop: 'assistTime',
    type: 'datetime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true,
    width: 90
  }, {
    width: 160,
    hide: false,
    type: 'select',
    label: '机电回馈差异原因',
    prop: 'jdReplyReason',
    formatter:function (row,v) {
      return getMappingStatus('JD_REPLY_REASON',v);
    },
    search: true,
	searchLabelWidth: 130,	
    dicData:[{
      label: '系统原因',
      value: '1'
    }, {
      label: '非系统原因',
      value: '2'
    }],
  },{
    width: 160,
    label: '机电回馈差异详情',
    prop: 'jdReplyDetail',
    hide: true
  }, {
    hide: false,
    label: '客运回馈差异原因',
    prop: 'kyReplyReason',
    formatter:function (row,v) {
      return getMappingStatus('KY_REPLY_REASON',v);
    },
    search: false,
    width: 160
  },{
    width: 160,
    label: '客运回馈差异详情',
    prop: 'kyReplyDetail',
    hide: true
  }, {
    type: "select",
    hide: false,
    label: '回馈状态',
    prop: 'kyReplySatus',
    formatter:function (row, value , label, column){
      return value == 1?'已反馈':'未反馈';
    },
    dicData:[{
      label: '未反馈',
      value: '0'
    }, {
      label: '已反馈',
      value: '1'
    }],
    search: true
  }]
}
export function getSwAuConductorToBeCheckedList(param) {
  return request({
    url: '/check/checkNew/getSwAuConductorToBeCheckedList',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorToBeChecked(param) {
  return request({
    url: '/check/checkNew/updateSwAuConductorToBeChecked',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorToBeCheckedToStatus(param) {
  return request({
    url: '/check/checkNew/updateSwAuConductorToBeCheckedToStatus',
    method: 'post',
    data: param
  })
}
export function updateSwAuConductorToBeCheckedToStatusKY(param) {
  return request({
    url: '/check/checkNew/updateSwAuConductorToBeCheckedToStatusKY',
    method: 'post',
    data: param
  })
}
/**
 * 导出
 * @param query
 */
 export function exportBOMXT(query) {
  return request({
    url: '/check/checkNew/exportBOMXT',
    method: 'get',
    params: query,
    responseType:'blob'
  })
}